// merchant//alliance/allianceData/index.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    allianceId: 0,
    dataInfo: {}
  },
  // 联盟商家
  toAllianceMerList: function(){
    wx.navigateTo({
      url: '../allianceMerList/index?allianceId=' + this.data.allianceId,
    })
  },

  // 联盟会员
  toMember: function(){
    wx.navigateTo({
      url: '../menber/index?allianceId=' + this.data.allianceId,
    })
  },

  // 核销笔数
  toCheckCounts: function(){
    wx.navigateTo({
      url: '../checkMoney/index?allianceId=' + this.data.allianceId,
    })
  },

  // 实付金额
  toCheckRealpay: function(){
    wx.navigateTo({
      url: '../checkMoney/index?allianceId=' + this.data.allianceId,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.allianceId){
      this.getAllianceData(options.allianceId);
      this.setData({
        allianceId: options.allianceId
      })
    }
  },

  // 联盟数据
  getAllianceData: function(allianceId){
    let that = this;
    wx.request({
      url: app.globalData.host + '/api/system/GetReportDetail?allianceid=' + allianceId,
      success: function(res){
        if(res.data.Code==0){
          if(res.data.Data){
            that.setData({
              dataInfo: res.data.Data
            })
          } 
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  }

 
})